
function CRRA = getCRRA(params)

U0       = params.U0;
U0d      = params.U0d;
BETTA    = params.BETTA;
B        = params.B;
CHI      = params.CHI;
CHI0     = params.CHI0;
THETA    = params.THETA;
DELTA    = params.DELTA;
PHI      = params.PHI;
ETA      = params.ETA;
ZI       = params.ZI;
NU       = params.NU;
MUZss    = params.MUZss;
lss      = params.lss;
KoY      = params.KoY;
PAIss    = params.PAIss;
ALFA     = params.ALFA;
%% Section 2: Solving for the steady state
% The real stoch discount factor
Mreal      = BETTA*MUZss^(-CHI*(1-CHI0)-CHI0);

% Value of capital
Kss        = ((4*KoY)^(1/(1-THETA)))*lss;  

% The output level
OUTPUTss   = Kss^THETA*lss^(1-THETA);

% The consumption level
Css        = (1-ZI/2*(PAIss/PAIss^NU-1)^2)*OUTPUTss - DELTA*Kss;

% Marginal costs
MCss       = 1/(ETA*OUTPUTss)*(ZI*(PAIss/PAIss^NU-1)*OUTPUTss*PAIss/PAIss^NU ...
               -(1-ETA)*OUTPUTss + ZI*Mreal*(PAIss/PAIss^NU-1)*PAIss/PAIss^NU*OUTPUTss*MUZss);

% The real wage
Wss        = MCss*(1-THETA)*Kss^THETA*lss^(-THETA);

% The parameter on disutility
PHIzero    = ((Css-B*Css*MUZss^-1)/Css^CHI0)^-CHI*Wss*(1-lss)^(1/PHI)/Css^CHI0;

% CRRA
term1 = CHI/(1-B*MUZss^-1+Wss/Css*CHI*(1-lss)/(1/PHI));
term2 = (1-CHI)/((1-CHI)*(U0+U0d)/Css^(CHI0*(CHI-1)+1)*(Css-B*Css*MUZss^-1)^CHI + (1-B*MUZss^-1)+ Wss/Css*(1-lss)*(1-CHI)/(1-1/PHI));
CRRA  = term1+term2*ALFA;


end